package com.kaviddiss.bootquartz.job;

import com.kaviddiss.bootquartz.bean.TestModel;
import com.kaviddiss.bootquartz.service.SampleService;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.PersistJobDataAfterExecution;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by david on 2015-01-20.
 */
public class SampleJob implements Job {
    @Autowired
    private SampleService service;

    public TestModel testModel = new TestModel();

    @Override
    public void execute(JobExecutionContext jobExecutionContext) {
        JobDataMap map = jobExecutionContext.getJobDetail().getJobDataMap();
        String str = map.getString("Test");
        service.hello(str);
    }

}
